// components/Match/PlayerItem/PlayerItem.js
const app = getApp()
Component({
  /**
   * 组件的属性列表
   */
  options: {
    styleIsolation: 'apply-shared'
  },
  properties: {
    playerData: Object,
    campTotal: Object
  },

  /**
   * 组件的初始数据
   */
  data: {
    hideHeight: 0
  },

  /**
   * 组件的方法列表
   */
  methods: {
    naviPlayer(e) {
      let accountid = e.target.dataset.accountid
      wx.navigateTo({
        url: `/pages/Player/Player?id=${accountid}`,
      })
    },
    show() {
      let hideHeight = 0
      if (this.data.hideHeight === 0) {
        hideHeight = '400rpx'
      }
      this.setData({
        hideHeight
      })
    },
    imageError(e) {
      this.data.playerData.abilities[e.target.dataset.errImg].icon = "../../../images/gift/gift.png";
      this.setData({
        playerData: this.data.playerData
      });
    },
  },
  lifetimes: {
    // 生命周期函数，可以为函数，或一个在methods段中定义的方法名
    attached: function() {

    },
    moved: function() {},
    detached: function() {},
  }
})